home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / cstrings.arc / STRDEL.C < prev    next >
Text File  |  1985-08-06  |  2KB  |  78 lines

  1. /*
  2.     CSTRINGS.LBR VERSION 1.0
  3.     Spark Software, Inc.
  4.  
  5.         If you find this software of use, it is requested that you send
  6.         a donation ($10.00 suggested) to:
  7.  
  8.             Spark Software, Inc.
  9.             24 Royal Crest Dr., #5
  10.             Nashua, NH  03060
  11.  
  12.         Upon receiving your donation, your name will be added to the 
  13.         List of Registered Users, and future updates can be obtained
  14.         from the SPARKIE RBBS at (603) 888-8179.
  15.  
  16.         If you include an extra $10.00 with your donation, the newest
  17.         version of CSTRINGS.LBR will be mailed to you.
  18.  
  19.         Call SPARKIE RBBS at the number above for other Spark Software
  20.         products!!!
  21. */
  22.  
  23. /*
  24.  * strd (s, n1, n)
  25.  * char *s;
  26.  * int n1, n;
  27.  *
  28.  * This function deletes all characters in string s from position n1 to 
  29.  * position n.  Basically the characters from position n to the end of 
  30.  * the string are copied to position n1.
  31.  */
  32.  
  33. strd (s, n1, n)
  34. char *s;
  35. int n1, n;
  36. {
  37.     char *c1, *c2;
  38.      
  39.     c1 = &s[n1];
  40.     c2 = &s[n];
  41.  
  42.     while ((*c1++ = *c2++) != '\0);
  43. } /* strd */
  44.  
  45. /*
  46.  * strdlf (s, n)
  47.  * char *s;
  48.  * int n;
  49.  *
  50.  * This function deletes the first n characters of string s.
  51.  */
  52.  
  53. strdlf (s, n)
  54. char *s;
  55. int n;
  56. {
  57.     char *c;
  58.  
  59.     c = &s[n];
  60.     while ((*s++ = *c++) != '\0);
  61. } /* strdlf */
  62.  
  63. /*
  64.  * strdrt (s, n)
  65.  * char *s;
  66.  * int n;
  67.  *
  68.  * This function deletes all of the characters in s from position n to
  69.  * the end of the string.
  70.  */
  71.  
  72. strdrt (s, n)
  73. char *s;
  74. int n;
  75. {
  76.     s[n] = '\0';
  77. } /* strdrt */
  78.